package com.wmeimob.fastboot.jiubei.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Date;

/**
 * @Author xuhongchang
 * @Date 2020/8/10  11:02 上午
 * @Describetion 会员表
 */
@Data
@Table(name = "member")
@EqualsAndHashCode(callSuper = false)
public class Member implements Serializable , UserDetails {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @Id
    @Column(name = "`id`")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 会员编号
     */
    @Column(name = "`vip_no`")
    private String vipNo;

    /**
     * 微信昵称
     */
    @Column(name = "`nickname`")
    private String nickname;

    /**
     * 真实姓名
     */
    @Column(name = "`full_name`")
    private String fullName;

    /**
     * 手机号
     */
    @Column(name = "`phone`")
    private String phone;

    /**
     * 性别：0.未知、1.先生、2.女士
     */
    @Column(name = "`sex`")
    private Integer sex;

    /**
     * 头像
     */
    @Column(name = "`head_img`")
    private String headImg;

    /**
     * 注册时间
     */
    @Column(name = "`gmt_register`")
    private Date gmtRegister;

    /**
     * 支付密码
     */
    @Column(name = "`pay_pwd`")
    private String payPwd;

    /**
     * 等级名称 1：VIP,2:SVIP,3:导购,4:超导
     */
    @Column(name = "`level`")
    private Integer level;


    /**
     * 中奖概率,默认为0，手动设置规则:不可低于0，大于1
     */
    @Column(name = "`winning_probability`")
    private BigDecimal winningProbability;

    /**
     * 上级ID
     */
    @Column(name = "`upper_id`")
    private Long upperId;

    /**
     * 上级姓名
     */
    @Column(name = "`upper_name`")
    private String upperName;

    /**
     * 上上级ID
     */
    @Column(name = "`more_upper_id`")
    private Long moreUpperId;

    /**
     * 上上级姓名
     */
    @Column(name = "`more_upper_name`")
    private String moreUpperName;

    /**
     * 生日
     */
    @Column(name = "`birthday_time`")
    private Date birthdayTime;

    /**
     * 创建人
     */
    @Column(name = "`create_by`")
    private String createBy;

    /**
     * 创建时间
     */
    @Column(name = "`create_time`")
    private Date createTime;

    /**
     * 更新人
     */
    @Column(name = "`update_by`")
    private String updateBy;

    /**
     * 更新时间
     */
    @Column(name = "`update_time`")
    private Date updateTime;

    /**
     * 余额
     */
    @Column(name = "`balance`")
    private BigDecimal balance;

    /**
     * 积分
     */
    @Column(name = "`integral`")
    private Integer integral;

    /**
     * 金币
     */
    @Column(name = "`gold_coin`")
    private BigDecimal goldCoin;

    /**
     * 一代下级数量
     */
    @Column(name = "`sub_num`")
    private Integer subNum;

    /**
     * 二代下级数量
     */
    @Column(name = "`sub_low_num`")
    private Integer subLowNum;

    /**
     * 团队人数
     */
    @Column(name = "`group_total_num`")
    private Integer groupTotalNum;


    /**
     * 1000金币当期累计金额
     */
    @Column(name = "`current_accumulated_amount_thousand`")
    private BigDecimal currentAccumulatedAmountThousand;

    /**
     * 1000金币上期获奖金额
     */
    @Column(name = "`last_award_amount_thousand`")
    private BigDecimal lastAwardAmountThousand;

    /**
     * 100金币当期累计金额
     */
    @Column(name = "`current_accumulated_amount_hundred`")
    private BigDecimal currentAccumulatedAmountHundred;

    /**
     * 100金币上期获奖金额
     */
    @Column(name = "`last_award_amount_hundred`")
    private BigDecimal lastAwardAmountHundred;

    /**
     * 有效用户数量（一代）
     */
    @Column(name = "`effective_member_count`")
    private Integer effectiveMemberCount;

    /**
     * 下属VIP人数
     */
    @Column(name = "`sub_vip_count`")
    private Integer subVipCount;

    /**
     * 下属SVIP人数
     */
    @Column(name = "`sub_svip_count`")
    private Integer subSvipCount;

    /**
     * 下属导购人数
     */
    @Column(name = "`sub_guide_count`")
    private Integer subGuideCount;

    /**
     * 下属超导人数
     */
    @Column(name = "`sub_sguide_count`")
    private Integer subSguideCount;

    /**
     * 个人中奖次数
     */
    @Column(name = "`person_winprize_count`")
    private Integer personWinprizeCount;

    /**
     * 团队中奖次数
     */
    @Column(name = "`team_winprize_count`")
    private Integer teamWinprizeCount;

    /**
     * 个人中奖金额累计
     */
    @Column(name = "`person_winprize_amount`")
    private BigDecimal personWinprizeAmount;

    /**
     * 团队中奖金额累计
     */
    @Column(name = "`team_winprize_amount`")
    private BigDecimal teamWinprizeAmount;


    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return null;
    }

    @Override
    public String getUsername() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }
}
